package com.project.forum.exception;

import com.project.forum.common.AppResult;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Time:12:08
 */
//自定义异常
public class ApplicationException extends RuntimeException{
    //在异常中持有一个错误信息
    protected AppResult errResult;

    //自己写的构造方法
    public ApplicationException(AppResult errResult){
        super(errResult.getMessage());//为了防止打印出来的是Runtime的异常，要的是app的异常
        this.errResult=errResult;
    }

    public AppResult getErrResult() {
        return errResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
